<template>
  <div class="app-container">

    <el-empty v-if="show && boardingStatus == '0'" description="请先完成登机"></el-empty>

    <el-empty v-else-if="show && boardingStatus == '1' && zztyJlJc == '0'"
              description="请将行李放置在对应中转值机传送带"></el-empty>

    <div v-if="show && boardingStatus == '1' && zztyJlJc == '1'">
      <el-card class="box-card">
        <div slot="header" class="clearfix">
          <span class="el-tag el-tag--success">当前行李已具备值机条件</span>
          <el-button  v-if="startZz == '0'"style="float: right;
           padding: 3px 0" type="text" @click="startZzZj"
          >启动值机
          </el-button>
          <span v-else style="float: right; padding: 3px 0; font-size: 14px; color: #8B0000">已启动值机</span>
        </div>
      </el-card>
    </div>
  </div>
</template>

<script>

import {startZj} from "@/api/ckxl/xl";

export default {
  name: "zzzj",
  props: ['boardingStatus', 'zztyJlJc', 'show', 'ckxlId', 'startZz', 'djLx'],
  data() {
    return {
    };
  },
  created() {
  },
  computed:{
  },
  methods: {

    /** 启动中转值机 */
    startZzZj() {
      var _this = this;
      this.$modal.confirm('是否确认启动值机？').then(function() {
        const data = {'ckxlId': _this.ckxlId, 'djLx': _this.djLx}
        return startZj(data);
      }).then(() => {
        this.$emit('start-zz-zj-success', '启动值机成功')
      }).catch(() => {});
    },

  }
};
</script>

<style lang="scss" scoped>
.text {
  font-size: 14px;
}

.item {
  margin-bottom: 18px;
}

.clearfix:before,
.clearfix:after {
  display: table;
  content: "";
}
.clearfix:after {
  clear: both
}

.box-card {
  width: 100%;
}
</style>
